home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8662 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  820 b 

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: assignment operator and inheritance
  5. Date: 25 Feb 1996 22:32:04 GMT
  6. Organization: self-employed
  7. Message-ID: <4gqo14$ci3@news.bridge.net>
  8. References: <candymanDn9C6L.Lq2@netcom.com>
  9. NNTP-Posting-Host: ppp-mia1-43.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16. >> What is the syntax to use the base class's assignment operator within 
  17. >> the child class's assignment operator definition?.
  18.  
  19.  
  20.  
  21. Child& operator=( const Child& rhs )
  22. {
  23.      Base::operator=( rhs ) ;      // Child& converts to Base& of course
  24.  
  25.      member = rhs.member ;
  26.       // etc etc
  27.      return *this ;
  28. }
  29.  
  30.  
  31.                          David
  32.  
  33.  
  34.  
  35.